package com.mycompany.sigemp.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mycompany.sigemp.model.Cliente;
import com.mycompany.sigemp.repository.ClienteRepository;
import com.mycompany.sigemp.service.ClienteService;

@Service
public class ClienteServiceImpl implements ClienteService {
	@Autowired
	ClienteRepository repository;

	@Override
	public Cliente obtenerClientePorCodigo(String codigo) {
		return repository.obtenerClientePorCodigo(codigo);
	}
    
	@Transactional
	@Override
	public void resgistrarUnCliente(Cliente c) {
		repository.resgistrarUnCliente(c);
	}

	@Override
	public void eliminarUnCliente(Cliente c) {
		repository.eliminarUnCliente(c);
	}

	@Transactional
	@Override
	public void actualizarCliente(Cliente c) {
		repository.actualizarCliente(c);
	}

	@Override
	public List<Cliente> obtenerTodosLosClientes() {
		return repository.obtenerTodosLosClientes();
	}

}
